<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- Head -->
<head>
    <meta charset="{echo C('S_CHARSET')}" />
    <title>{echo C('sitename')}后台登录</title>

    <meta name="description" content="后台管理" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <me http-equiv="Content-Type" content="text/html; charset={echo C('S_CHARSET')}" />
    <link rel="shortcut icon" href="/favicon.png" type="image/x-icon">
    {template Public:Page:css}
    {template Public:Page:js}
</head>
<body>
<span id="UserUid" style="display:none">0</span>
<form data-bv-feedbackicons-validating="glyphicon glyphicon-refresh" data-bv-feedbackicons-invalid="glyphicon glyphicon-remove" data-bv-feedbackicons-valid="glyphicon glyphicon-ok" data-bv-message="值不能为空" class="form-horizontal bv-form" method="post" id="loginForm" novalidate>
    <div class="login-container animated fadeInDown">
        <div class="loginbox bg-white">
            <div class="loginbox-title">{echo C('sitename')}后台登录</div>
			<hr/>
            <div class="loginbox-textbox">
            	 <div class="form-group has-feedback" style="margin:0px;">
                 <input class="form-control" id="username" name="username" placeholder="用户名/邮箱/手机" type="text" value="" data-bv-notempty="true" data-bv-notempty-message="&lt;i class='fa fa-frown-o'&gt;&lt;/i&gt; 对不起！请输入用户名！" data-bv-stringlength="true" data-bv-stringlength-min="3" data-bv-stringlength-message="&lt;i class='fa fa-frown-o'&gt;&lt;/i&gt; 对不起！用户名有误,用户名长度不能小于3位！"/>
                 </div>
            </div>
            <div class="loginbox-textbox">
           		 <div class="form-group has-feedback" style="margin:0px;">
                 <input type="password" value="" placeholder="密码" data-bv-field="password" class="form-control" AUTOCOMPLETE="off"  name="password" data-bv-notempty="true" data-bv-notempty-message="&lt;i class='fa fa-frown-o'&gt;&lt;/i&gt; 对不起！请输入密码！" data-bv-stringlength="true" data-bv-stringlength-min="6" data-bv-stringlength-message="&lt;i class='fa fa-frown-o'&gt;&lt;/i&gt; 对不起！密码长度不能小于6位！">
                 </div>
      		
            </div>
            
            <div class="loginbox-textbox">
                 <div class="form-group has-feedback" id="MobileCode" style="display:none;margin:0px;">
                      <input type="text" name="mobilecode" class="form-control" AUTOCOMPLETE="off" >
                      <small data-bv-validator-for="mobilecode" class="help-block" id="MobileCodeHelp"></small> 
                  </div>
            </div>
            {if C('Geetest_Key')}
            <div class="loginbox-textbox">
                <div id="ShowSecCode">{hook VerifyCode}</div>
             </div>
            {else}
            <div class="loginbox-textbox">
                  <div class="form-group has-feedback" style="margin:0px;">
                      <input type="text" name="seccode" class="form-control" id="SecCode" placeholder="验证码" AUTOCOMPLETE="off" >
                      <i class="form-control-feedback glyphicon glyphicon-eye-open" data-bv-field="seccode"></i> 
                   </div>
             </div>
              <div class="loginbox-textbox">
              <div id="ShowSecCode"></div>
              </div>
            <script>

				function seccode(){
					 var img='/VerifyCode?rand='+Math.random();
					 $('#ShowSecCode').html('<a href="javascript:;" onclick="refreshcode()" style="cursor:hand;" title="点击换一张验证码"><img id="img_seccode" src="'+img+'"></a>');
					 $("#SecCode").val("");
				}
				
				function refreshcode() {
					
					var img = '/VerifyCode?rand='+Math.random();
					if(document.getElementById('img_seccode')) {
						$('#img_seccode').attr("src",img);
					}
				}
				
				$(function(){
				
					  seccode();
				
				});
			</script>
            {/if}

            <div class="loginbox-submit">
                <button class="btn btn-primary btn-block" type="submit">登 录</button>
                <input type="hidden" name="datatype" value="json"/>
  				<input type="hidden" name="Submit" value="true"/>
            </div>
        </div>
    </div>
</form>
<script src="/assets/js/bootstrap.min.js"></script>
<script src="/assets/js/bootbox/bootbox.js"></script>
<script src="/assets/js/validation/bootstrapValidator.js"></script>

<script>

	$(document).ready(function () {
	
	  $('#loginForm').bootstrapValidator({
			excluded: [':disabled'],
			feedbackIcons: {
				valid: 'glyphicon glyphicon-ok',
				invalid: 'glyphicon glyphicon-remove',
				validating: 'glyphicon glyphicon-refresh'
			},
			submitHandler: function (form) {

			bootbox.hideAll();
	
			  $.post('/admin/login/post',$("#loginForm").serialize(), function(json) {
				
					$('.bootbox').PhpappProgress({json:json});
	
					return true;
				
			  }, 'json');
	
	
			 bootbox.dialog({
				 message: '<div class="progress progress-striped active"><div style="width: 1%" aria-valuemax="100" aria-valuemin="0" aria-valuenow="20" role="progressbar" class="progress-bar progress-bar-info"><span>0%</span></div></div>',
				 title: '<i class="icon fa fa-retweet"></i> 登录中',
				 closeButton: false
			 }).PhpappProgress({time:1000});
		 
			  return false; 
			 
			}
	
		}) 
	
	});
	
	
	$(function(){
		 $("i[data-bv-field='remember']").remove();
	});

</script>

</body>
</html>
